$DIR = "/data2/bsi/RandD/bora/methylation";
$DIR_OUT = "/data2/bsi/RandD/bora/methylation_result";
$dir =`ls $DIR`;
@dir =split("\n",$dir);
#print "@dir\n";
for($i=0;$i<@dir;$i++)
{
	if($dir[$i] =~ m/evel_1/)
	{
		#print "$dir[$i]\n";
		system("rm $DIR/$dir[$i]/CHANGES_DCC.txt $DIR/$dir[$i]/DESCRIPTION.txt  $DIR/$dir[$i]/MANIFEST.txt $DIR/$dir[$i]/README_DCC.txt");
		open(BUFF,">$DIR/config_exp");
		print BUFF "INPUT_FOLDER=$DIR/$dir[$i]\n";
		print BUFF "OUTPUT_FOLDER=$DIR_OUT/$dir[$i]\n";
		open(BUFF,">sampleexecution");
		print BUFF "perl /data1/bsi/BORA_processing/devel/methylation/methylation_V1/bin/mainscript_methylation.pl -config $DIR/config_exp\n";
		close(BUFF);		
		system("sh $DIR/sampleexecution");
	}
}
